const http = require('http')
const url  = require('url')

const port = 3000
const hostname = '127.0.0.1'
const server = http.createServer((req, res) => {
    const queryObject = url.parse(req.url, true).query
    console.log(queryObject)
    const name = queryObject.name
    const age  = queryObject.age
    res.end('服务器收到了表单请求' + name + age)
})


server.listen(port, hostname, () => {
    console.log(`server running on port ${port}`)
})